#!/bin/bash
sqoop export \
--connect jdbc:mysql://192.168.88.148:3306/ads \
--username root \
--password 123456 \
--table ads_aml_customer_risk_profile \
--export-dir /user/hive/warehouse/ads.db/ads_aml_customer_risk_profile/000000_0 \
--input-fields-terminated-by '\001' \
--input-lines-terminated-by '\n' \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
-m 1

arr=(ads_aml_alert_efficiency ads_aml_customer_risk_profile ads_aml_daily_risk_report ads_aml_regulatory_monthly)

for i in ${arr[@]}; do
    sqoop export \
    --connect jdbc:mysql://192.168.88.148:3306/ads \
    --username root \
    --password 123456 \
    --table $i \
    --hcatalog-database ads \
    --hcatalog-table $i \
    --input-fields-terminated-by '\001' \
    --input-lines-terminated-by '\n' \
    --input-null-string '\\N' \
    --input-null-non-string '\\N' \
    -m 1
done